﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="admin_message.aspx.cs" Inherits="admin_message" MasterPageFile="~/Admin.master"%>
<asp:Content  ContentPlaceHolderID="main_style" runat="server">
    <link href="Styles/album.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ContentPlaceHolderID="main_left" runat="server">
    <form id="form1" runat="server">
    <h1>消息管理</h1>
    <br/>
    <asp:GridView ID="GridView1" DataSourceID="mysource" DataKeyNames="cid" 
        AutoGenerateEditButton="True" AutoGenerateDeleteButton="True" runat="server" 
        Width="800px" AllowPaging="True" AllowSorting="True" 
        AutoGenerateColumns="False" BackColor="White" BorderColor="#DEDFDE" 
        BorderStyle="None" BorderWidth="1px" CellPadding="4" ForeColor="Black" 
        GridLines="Vertical">
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:BoundField DataField="cid" HeaderText="评论id" InsertVisible="False" 
                ReadOnly="True" SortExpression="cid" />
            <asp:BoundField DataField="pid" HeaderText="图片id" SortExpression="pid" ReadOnly="true"/>
            <asp:BoundField DataField="uid" HeaderText="用户id" SortExpression="uid" ReadOnly="true"/>
            <asp:BoundField DataField="sid" HeaderText="原作者id" SortExpression="sid" ReadOnly="true"/>
            <asp:BoundField DataField="content" HeaderText="评论内容" 
                SortExpression="content" />
            <asp:BoundField DataField="share" HeaderText="是否分享(1:是)" SortExpression="share" ReadOnly="true"/>
            <asp:BoundField DataField="time" HeaderText="评论时间" SortExpression="time" ReadOnly="true"/>
            <asp:BoundField DataField="state" HeaderText="是否收藏(1:是)" 
                SortExpression="state" ReadOnly="true"/>
        </Columns>

        <FooterStyle BackColor="#CCCC99" />
        <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
        <RowStyle BackColor="#F7F7DE" />
        <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
        <SortedAscendingCellStyle BackColor="#FBFBF2" />
        <SortedAscendingHeaderStyle BackColor="#848384" />
        <SortedDescendingCellStyle BackColor="#EAEAD3" />
        <SortedDescendingHeaderStyle BackColor="#575357" />

    </asp:GridView>
    <asp:SqlDataSource ID="mysource" runat="server" 
        ConnectionString="<%$ ConnectionStrings:photoGalleryConnectionString %>" 
        DeleteCommand="DELETE FROM [comment] WHERE [cid] = @cid" 
        SelectCommand="SELECT * FROM [comment]" 
        UpdateCommand="UPDATE [comment] SET [content] = @content, [state] = @state WHERE [cid] = @cid">
        <DeleteParameters>
            <asp:Parameter Name="cid" Type="Int32" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="content" Type="String" />
            <asp:Parameter Name="state" Type="String" />
            <asp:Parameter Name="cid" Type="Int32" />
        </UpdateParameters>
    </asp:SqlDataSource>
    </form>
</asp:Content>
<asp:Content  ContentPlaceHolderID="main_right" runat="server">
    <div id="uploadlink" class="rblock" runat="server">
        <div class="title1">&gt;<a href="admin_pic.aspx">图片管理</a></div>
        <div class="title1">&gt;<a href="admin_usermgr.aspx">用户管理</a></div>
        <div class="title1">&gt;<a href="admin_message.aspx">消息管理</a></div>
        <div class="title1">&gt;<a href="admin_personal.aspx">修改密码</a></div>
    </div>
</asp:Content>
